package ex16;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) throws IOException {
		
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		
//		vx = 60 km/h 
//		vy = 90 km/h 
//		sx = 10 km 
//
//		s=so+v.t 
//		sx = 10 + 60.t 
//		sy = 0 + 90.t 
//
//		encontro : sx=sy 
//
//		10 + 60 .t = 90 .t 
//		10 = 30.t 
//
//		t = 1/3 hora ------------------ como 1 hora = 60 minutos ( 1/3.60) = 20 minutos
		
		int x = 60, y = 90;
		double sx = 0, sy = 0;
		double t = 0, time = 0;
		int km = Integer.parseInt(in.readLine());
		
		while (true) {
			
			sx = km + x * t;
			sy = 0 + y * t;
			
			if (sx == sy) {
				time = km + y * t;
				time = time * t;
				time = 30 * 90;
				//time = 
				break;
			}
			t+=0.1;
		}
		System.out.println(time);
		
		
	}

}
